import Vue from 'vue';
import VueResource from 'vue-resource';
import redpack from './redpack.vue';
import common from "../../assets/js/common.js";
Vue.use(VueResource);

//登录信息传输到后台
var backUrl = common.isdev()+"/user/checkLogin.htm";        
var hrefUrl = window.location.href;        
if(hrefUrl.indexOf("?userInfo=") > -1){
    backUrl = backUrl + hrefUrl.substring(hrefUrl.indexOf("?userInfo="));
}

Vue.filter('addCa', function( val ,type) {
  if ( val && type ==='0') {
    var val = '天天礼包_' + val + '$去领取';
    return val;
  }else{
    var val = '天天礼包_' + val + '$去查看';
    return val;
  }
});

var promise = Vue.http.post(backUrl).then(function(d) {
    console.info('success');
}, function(err) {
    console.info('err');
});
promise.then(function ( response ) {
    new Vue({
        el: '#app',   
        render: h => h(redpack)
    });
    // 成功回调
});




